﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class User_Register : System.Web.UI.Page
{
    DataClassesDataContext db = new DataClassesDataContext();

    protected void Page_Load(object sender, EventArgs e)
    {
        Button1.Attributes.Add("OnClick", "message()");
    }

    protected void Button1_Click(object sender, EventArgs e)
    {


        if (Page.IsValid)
        {
            string JobId = TextBox1.Text.Trim();
            string Password = TextBox2.Text.Trim();
            string Name = TextBox4.Text.Trim();
            string Email = TextBox5.Text.Trim();
            string Phone = TextBox6.Text.Trim();


            UserInfo userInfo = new UserInfo();
            userInfo.JobId = JobId;
            userInfo.Password = Password;
            userInfo.Identity = "Developer";
            userInfo.Name = Name;
            userInfo.Email = Email;
            userInfo.Phone = Phone;

            db.UserInfo.InsertOnSubmit(userInfo);
            db.SubmitChanges();

            Response.Redirect("Login.aspx?JobId="+JobId+"&Type=Register");
        }

    }
}